{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "3aaf679d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"rule\": [[{\"key\": \"LINKED_ACCOUNT\", \"oper\": \"include\", \"values\": \"848318613114\"}, {\"key\": \"sgt:cluster\", \"oper\": \"exclude\", \"values\": [\"ADS-eks-bigdata-use1-prod\", \"ADS-eks-bigdata-apse1-prod\", \"BDP-eks-bigdata-use1-prod\", \"bdp-flink-sg1-prod\", \"bdp-flink-ue1-prod\", \"sprs-bigdata-ue1-prod\", \"CBS-eks-bigdata-use1-prod\", \"cbs-bigdata-ue1-prod\", \"do-bigdata-ue1-prod\", \"do2-bigdata-ue1-prod\", \"shareit-bigdata-ue1-prod\"]}, {\"key\": \"SERVICE\", \"oper\": \"exclude\", \"values\": \"Amazon Simple Storage Service\"}, {\"key\": \"sgt:group\", \"oper\": \"include\", \"values\": \"CBS\"}, {\"key\": \"sgt:cost\", \"oper\": \"include\", \"values\": \"BDP\"}]]}\n"
     ]
    }
   ],
   "source": [
    "import json\n",
    "# 字符串转json\n",
    "a_str=\"{\\\"rule\\\": [[{\\\"key\\\": \\\"LINKED_ACCOUNT\\\", \\\"oper\\\": \\\"include\\\", \\\"values\\\": \\\"848318613114\\\"}, {\\\"key\\\": \\\"sgt:cluster\\\", \\\"oper\\\": \\\"exclude\\\", \\\"values\\\": [\\\"ADS-eks-bigdata-use1-prod\\\", \\\"ADS-eks-bigdata-apse1-prod\\\", \\\"BDP-eks-bigdata-use1-prod\\\", \\\"bdp-flink-sg1-prod\\\", \\\"bdp-flink-ue1-prod\\\", \\\"sprs-bigdata-ue1-prod\\\", \\\"CBS-eks-bigdata-use1-prod\\\", \\\"cbs-bigdata-ue1-prod\\\", \\\"do-bigdata-ue1-prod\\\", \\\"do2-bigdata-ue1-prod\\\", \\\"shareit-bigdata-ue1-prod\\\"]}, {\\\"key\\\": \\\"SERVICE\\\", \\\"oper\\\": \\\"exclude\\\", \\\"values\\\": \\\"Amazon Simple Storage Service\\\"}, {\\\"key\\\": \\\"sgt:group\\\", \\\"oper\\\": \\\"include\\\", \\\"values\\\": \\\"CBS\\\"}, {\\\"key\\\": \\\"sgt:cost\\\", \\\"oper\\\": \\\"include\\\", \\\"values\\\": \\\"BDP\\\"}]]}\"\n",
    "a_dict=json.loads(a_str)\n",
    "print(json.dumps(a_dict))\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "fb089186",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "{\"SHAREit->\\u7814\\u53d1\\u4ea4\\u4ed8\\u4e2d\\u5fc3->SHAREit\\u7814\\u53d1-SCAS->HW\": 1086.9605126600002, \"SHAREit->\\u7814\\u53d1\\u4ea4\\u4ed8\\u4e2d\\u5fc3->SHAREit\\u7814\\u53d1-SCAS->AWS\": 180.6494776247, \"SHAREit->\\u7814\\u53d1\\u4ea4\\u4ed8\\u4e2d\\u5fc3->SHAREit\\u7814\\u53d1-SBOS->HW\": 415.08963807000003, \"SHAREit->\\u7814\\u53d1\\u4ea4\\u4ed8\\u4e2d\\u5fc3->SHAREit\\u7814\\u53d1-SBOS->AWS\": 8.2341837951, \"SHAREit->\\u5927\\u6570\\u636e->Beyla-collect\": 1458.3203997359}\n"
     ]
    }
   ],
   "source": [
    "a_dict={'SHAREit->研发交付中心->SHAREit研发-SCAS->HW': 1086.9605126600002, 'SHAREit->研发交付中心->SHAREit研发-SCAS->AWS': 180.6494776247, 'SHAREit->研发交付中心->SHAREit研发-SBOS->HW': 415.08963807000003, 'SHAREit->研发交付中心->SHAREit研发-SBOS->AWS': 8.2341837951, 'SHAREit->大数据->Beyla-collect': 1458.3203997359}\n",
    "print(json.dumps(a_dict))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "2baece9f",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "python",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.9.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
